#include<iostream>
#include<queue>
using namespace std;

typedef long long LL;
LL n, k;
priority_queue<LL> heap;

int main()
{
    cin>>n>>k;
    LL sum1=0,x=0;
    while(n--)
    {
        
        cin>>x;
        sum1 += x;
        if(x%2==0) heap.push(x);
    }
    
    while(heap.size()&&k--)
    {
        LL tmp = heap.top()/2;
        heap.pop();
        sum1 -=tmp;
        if(tmp%2==0) heap.push(tmp);
        
    }
    cout<<sum1<<endl;
    return 0;
}